package com.hxzy.shop.controller.freight;


import com.github.pagehelper.PageInfo;
import com.hxzy.shop.dto.freight.req.LogisticsCompanyReq;
import com.hxzy.shop.dto.freight.resp.ExpressLogisticsResp;
import com.hxzy.shop.entity.FreightRule;
import com.hxzy.shop.entity.LogisticsCompanyInformation;
import com.hxzy.shop.feign.freight.FreightFeign;
import com.hxzy.shop.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@Api(tags = "快递100物流查询")
@RestController
@RequestMapping("expressLogistics")
public class ExpressLogisticsController {

    @Resource
    private FreightFeign freightFeign;

    @ApiOperation(value = "查询支持的物流公司信息")
    @PostMapping(value = "/getList")
    public Result<PageInfo<LogisticsCompanyInformation>> getList(@RequestBody LogisticsCompanyReq req) {
        return freightFeign.getList(req);
    }

    @ApiOperation(value = "查询物流")
    @GetMapping(value = "/get")
    public Result<ExpressLogisticsResp> get(@RequestParam("orderId") String order){
        return freightFeign.get(order);

    }
}
